<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="<c:url value='/resource/css/main.css'/>"/>
    <script type="text/javascript" src="<c:url value='/resource/js/jquery-1.11.1.min.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/resource/js/num-alignment.js'/>"></script>
    <title>分发单位</title>
</head>
<body class="f8">

<p class="tit">选择分发管理员</p>
<div class="main_box w_bac">
    <ul>
        <c:forEach items="${position}" varStatus="status" var="list">
            <li>
                <span class="radio_span" id="${status.index}" value="${list.guid}" name="${list.positionname}"></span>
                <i class="radio_i" >${list.positionname}</i>
            </li>
        </c:forEach>

    </ul>

</div>
<div class="btn_box2">
    <input class="all_btn sure" type="submit" value="确定" onclick="sub()"/>
    <input class="all_btn cancel"  onclick="history.back()" value="取消" />
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $(".radio_span").click(function() {
            $(this).toggleClass("hov");
            $(this).parent("li").siblings("li").children(".radio_span").removeClass("hov");
        });
    })
    function sub(){
        var val=$(".radio_span.hov").attr('value');
        var name=$(".radio_span.hov").attr('name');
        $.ajax({
            url: "<c:url value='/pssh/giveOut/'/>${ProjectGuid}",
            data:{
                distributeId: val,
                distributeName:name
            },
            type: "GET",
            dataType: "json",
            success: function (resp) {
                if (resp.succ) {
                    alert(resp.msg);
                    window.location.href="<c:url value='/pssh/index'/>"
                } else {
                    alert(resp.msg);
                    return false;
                }
            }
        });
    }
</script>
</body>
</html>